package com.sunda.spmsoversea.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sunda.spmsoversea.entity.OverseaDeliveryNoteDtl;
import com.sunda.spmsoversea.mapper.OverseaDeliveryNoteDtlMapper;
import com.sunda.spmsoversea.service.IOverseaDeliveryNoteDtlService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 海外仓交货单明细表 服务实现类
 * </p>
 *
 * @author Wayne
 * @since 2021-10-22
 */
@Service
public class OverseaDeliveryNoteDtlServiceImpl extends ServiceImpl<OverseaDeliveryNoteDtlMapper, OverseaDeliveryNoteDtl> implements IOverseaDeliveryNoteDtlService {

    @Override
    public List<Map<String, Object>> getDnItems(String sapDeliveryNote) {
        return this.baseMapper.getDnItems(sapDeliveryNote);
    }

    @Override
    public List<Map<String, Object>> getDnBoxItems(String sapDeliveryNote) {
        return this.baseMapper.getDnBoxItems(sapDeliveryNote);
    }

    @Override
    public List<Map<String, Object>> getOverchargedItemsToSap(String sapDeliveryNote) {
        return this.baseMapper.getOverchargedItemsToSap(sapDeliveryNote);
    }

    @Override
    public List<Map<String, Object>> getUnderchargedItemsToSap(String sapDeliveryNote) {
        return this.baseMapper.getUnderchargedItemsToSap(sapDeliveryNote);
    }

    @Override
    public List<Map<String, Object>> getUnderchargedItemsToSapAnomalyPost(String sapDeliveryNote, String costCenter) {
        return this.baseMapper.getUnderchargedItemsToSapAnomalyPost(sapDeliveryNote, costCenter);
    }

    @Override
    public OverseaDeliveryNoteDtl getOverseaDeliveryNoteDtl(String sapDeliveryNote, String sapDeliveryNoteItem) {
        QueryWrapper<OverseaDeliveryNoteDtl> queryWrapper = new QueryWrapper<OverseaDeliveryNoteDtl>()
                .eq("SAP_DELIVERY_NOTE", sapDeliveryNote).eq("SAP_DELIVERY_NOTE_ITEM", sapDeliveryNoteItem);
        return this.baseMapper.selectOne(queryWrapper);
    }
}
